<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h2></h2>
<script>
  let lengthOfLongestSubstring = function (s){
      let arr = [];
      let max = 0;
      for(let str of s){
          while(arr.include(str)){
              arr.shift()
          }
          arr.push(str)
          max = Math.max(0,arr.length)
      }
      return max
  }
</script>
</body>
</html>
